Skip to content

Workflow window session hard close#2021

Merged
idimov-keeper merged 4 commits intoreleasefrom
workflow-window-session-hard-close
May 7, 2026
Merged

Workflow window session hard close#2021
idimov-keeper merged 4 commits intoreleasefrom
workflow-window-session-hard-close

Conversation

@idimov-keeper
Copy link
Copy Markdown
Contributor

No description provided.

When the workflow lease expires for `pam tunnel start` or `pam launch`,
soft-close the tube now and escalate to keeper_pam_webrtc_rs's new
force_close_tube after 3s. Force-close drops the local TCP listener and
severs in-flight forwarded TCP streams (SSH, MySQL, etc.), which the
prior soft-close did not — an active session would linger past expiry
until the user disconnected manually.

Escalation is gated on both endpoints supporting force_close_tube:
hasattr(tube_registry, "force_close_tube") on the local crate AND
remote SDP-advertised version >= FORCE_CLOSE_MIN_VERSION ("2.1.18").
Older peers fall back to soft close only.

- tunnel_helpers: add escalate_close() shared helper plus
  FORCE_CLOSE_MIN_VERSION / FORCE_CLOSE_DELAY_SECONDS constants;
  consolidate _version_at_least here as the single source of truth
  (terminal_connection.py re-exports for back-compat with launch.py)
- tunnel_and_connections: replace the previously-commented-out soft
  close in `pam tunnel start`'s lease-expiry callback with escalate_close
- pam_launch/launch: wire escalate_close into `pam launch`'s
  _on_lease_expired (was only setting flags before, no tube close)
@idimov-keeper idimov-keeper merged commit b8fccee into release May 7, 2026
4 checks passed
@idimov-keeper idimov-keeper deleted the workflow-window-session-hard-close branch May 7, 2026 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant